#pragma once
#include <cstdint>

namespace linkfabric {
enum class ChannelPermission : uint8_t {
    NONE = 0,
    READ = 1,
    WRITE = 2,
    READWRITE = 3
};

inline ChannelPermission operator|(ChannelPermission lhs, ChannelPermission rhs) {
    return static_cast<ChannelPermission>(
        static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
}

inline ChannelPermission operator&(ChannelPermission lhs, ChannelPermission rhs) {
    return static_cast<ChannelPermission>(
        static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
}

inline bool operator==(ChannelPermission lhs, ChannelPermission rhs) {
    return static_cast<uint8_t>(lhs) == static_cast<uint8_t>(rhs);
}
}

